package CarLease.entity;

public class Bus extends Car {
    //子类属性巴士有座位数
    private final int seatNum;

    public Bus(String carId, String model, String color, double price, double displacement, int seatNum) {
        super(carId, model, color, price, displacement);
        this.seatNum = seatNum;
    }

    //Bus 的租金计算方法
    @Override
    public double calculateRent(int day) {
        return day * (1000 + seatNum * 50);
    }

    //重写父类的showInfo方法
    @Override
    public void showSpecialInfo() {
        System.out.println("座位数：" + seatNum);
    }
}
